#ifndef HISTORYFORM_H
#define HISTORYFORM_H

#include <QWidget>
#include "qcustomplot.h"


namespace Ui {
class HistoryForm;
}


class HistoryForm : public QWidget
{
    Q_OBJECT

public:
    explicit HistoryForm(QWidget *parent = nullptr);
    ~HistoryForm();
    void initDataList();
    void closeEvent(QCloseEvent *e);
    void FirFilter_2(double *b, int inputlength, double *x, QList<double> y);
    void drawLowWaveformPlot();
    void drawHighWaveformPlot();
    void acceptMessage(QList<double> list1);
    int pause_status = 0;
    //int pause_status_time = 200;
    void message_show();
    void showSignalInfo(double singnal,int hzType);
    void DataAnalysis();
    FILE *fp = NULL;
    int currIndex = 0; //当前行；
    int playStatus = 0; //播放状态 1正在播放；2播放结束；
private slots:
    void on_pushButton_2_clicked();
    void on_pushButton_3_clicked();

    void on_horizontalSlider_2_actionTriggered(int action);

private:
    Ui::HistoryForm *ui;
    QString fileName;

    QVector<double> x_1, y_1; //初始化向量x和y
    QCPGraph * curGraph_1;
    QCPTextElement *m_title_1;
    QVector<double> x_2, y_2; //初始化向量x和y
    QCPGraph * curGraph_2;
    QCPTextElement *m_title_2;
    QVector<double> x_3, y_3; //初始化向量x和y
    QCPGraph * curGraph_3;
    QCPTextElement *m_title_3;
    QVector<double> x_4, y_4; //初始化向量x和y
    QCPGraph * curGraph_4;
    QCPTextElement *m_title_4;


    QVector<double> x_5, y_5; //初始化向量x和y
    QCPGraph * curGraph_5;
    QCPTextElement *m_title_5;
    QVector<double> x_6, y_6; //初始化向量x和y
    QCPGraph * curGraph_6;
    QCPTextElement *m_title_6;
    QVector<double> x_7, y_7; //初始化向量x和y
    QCPGraph * curGraph_7;
    QCPTextElement *m_title_7;
    QVector<double> x_8, y_8; //初始化向量x和y
    QCPGraph * curGraph_8;
    QCPTextElement *m_title_8;
};

#endif // HISTORYFORM_H
